#include <QtCore>
#include <string>
#include <vector>
#include <list>
#include "PacketUtil/GateWay.h"
#include "TriplePattern.h"
#include "NTuple.h"
#include <sstream>
#include <iostream>

#ifndef _QUERYPACKET_H_
#define _QUERYPACKET_H_


			/////////////////////////////////////////////////////////////////////
			//			resultFile data structure
			//	  | query_ID | subquery_size | current_subquery_num |  whole_query |
			//    | query 1..|....query n	 | coordinate 1  ...| ... coordinate n |
			//    | variable_size | variable 1 ...|... variable n |
			//    | pattern 1|....pattern n  | partial_ans_1....|... partial_ans_n |
			//
			////////////////////////////////////////////////////////////////////
class QueryPacket{
public:
	QueryPacket();
	~QueryPacket();
	QueryPacket(std::string f);
	void setFileName(std::string f);
	void readFormFile();
	void writetoFile();
	std::string toString();
	std::string iToString(int i);
public:
	std::string fileName;
	int query_id;
	int subquery_size;
	int current_subquery;
	std::string whole_query;
	std::vector<std::string> sub_query;
	std::vector<GateWay> destination;
	int variable_size;
	std::vector<std::string>  variables;  //全局目标变量
	std::vector<std::vector<std::string> > subquery_variables;
	std::vector<TriplePattern> subquery_patterns;
	int ans_size;
	std::vector<NTuple> partial_ans;
	QString data_qstr;
	QStringList data_list;
};
#endif //_QUERYPACKET_H_
